<?php
	
	// Markiert alle Kunden einer Route
	/////////////////////////////////////////
	/////////////////////////////////////////
	
	// Array zum speichern der Wegpunkte
	$arr = Array();

	// Wegpunkte
	$waypoint0 = $_GET['waypoint0']; if(!$waypoint0) $waypoint0 = 0; else array_push($arr,$waypoint0);
	$waypoint1 = $_GET['waypoint1']; if(!$waypoint1) $waypoint1 = 0; else array_push($arr,$waypoint1);
	$waypoint2 = $_GET['waypoint2']; if(!$waypoint2) $waypoint2 = 0; else array_push($arr,$waypoint2);
	$waypoint3 = $_GET['waypoint3']; if(!$waypoint3) $waypoint3 = 0; else array_push($arr,$waypoint3);
	$waypoint4 = $_GET['waypoint4']; if(!$waypoint4) $waypoint4 = 0; else array_push($arr,$waypoint4);
	$waypoint5 = $_GET['waypoint5']; if(!$waypoint5) $waypoint5 = 0; else array_push($arr,$waypoint5);
	$waypoint6 = $_GET['waypoint6']; if(!$waypoint6) $waypoint6 = 0; else array_push($arr,$waypoint6);
	$waypoint7 = $_GET['waypoint7']; if(!$waypoint7) $waypoint7 = 0; else array_push($arr,$waypoint7);

	// DB-Verbindung herstellen
	include("connect.php");
	
	// Kunden markieren die zu einer Route gehören
	for($i = 0; $i < count($arr); $i++){
		$result=mysql_query("UPDATE abrechnung SET k_onRoute = '1' WHERE k_id = '$arr[$i]'");
	}
	
	// DB-Verbindung schließen
	echo mysql_error();
	mysql_close();

?>
